core: Replace pack superindex via rename() rather than truncating
authorColin Walters <walters@verbum.org>
Mon, 14 May 2012 14:21:05 +0000 (10:21 -0400)
committerColin Walters <walters@verbum.org>
Mon, 14 May 2012 15:22:18 +0000 (11:22 -0400)
This helps allow cloning repositories via "cp -al".

src/libotutil/ot-variant-utils.c

index b9b85047af61a1c129cd9b8fc632d0f81eec7e7b..513776ef32a2ee6f8061c67b90bf3f2f5630017d 100644 (file)
@@ -69,7 +69,8 @@ ot_util_variant_save (GFile *dest,
   ot_lobj GOutputStream *out = NULL;
   gsize bytes_written;
   
-  out = (GOutputStream*)g_file_replace (dest, NULL, 0, FALSE, cancellable, error);
+  out = (GOutputStream*)g_file_replace (dest, NULL, G_FILE_CREATE_REPLACE_DESTINATION, FALSE,
+                                        cancellable, error);
   if (!out)
     goto out;